import { init } from "snabbdom/build/package/init"
import { h } from "snabbdom/build/package/h"
// 导入模块
import { styleModule } from "snabbdom/build/package/modules/style"
import { eventListenersModule } from "snabbdom/build/package/modules/eventlisteners"
// 注册模块

let patch = init([
    styleModule,
    eventListenersModule
])

let vnode = h("div#container",[
    h('h1',{ style: { background:"plum" } },"hello snabbdom"),
    h("p",{ on: { click:eventHandelr } },"hello")
])
function eventHandelr(){
    console.log("点击")
}
let app = document.querySelector("#app")

let oldVnode = patch(app,vnode)